package com.itheima.test;

public class ArrTest4 {
    public static void main(String[] args) {
        //最大值
        int[] arr = {33,5,22,44,55};
        int max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (max < arr[i]) max = arr[i];
        }
        System.out.println(max);

        //最小值
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (min > arr[i]) min = arr[i];
        }
        System.out.println(min);
    }
}
